package com.easemob.chatuidemo.utils;

import com.easemob.chatuidemo.domain.User;

import android.content.Context;
import android.content.SharedPreferences;

public class SharedPreferencesUtil {
    private static SharedPreferences sharedPreferences;

    private SharedPreferencesUtil() {

    };

    public static void create(Context context) {
        sharedPreferences = context.getSharedPreferences("filename",
                Context.MODE_PRIVATE);
    }

    public static void put(String key, String value) {
        sharedPreferences.edit().putString(key, value).commit();
    }

    public static String get(String key) {
        return sharedPreferences.getString(key, "");
    }
    
    public static void clearn(){
        sharedPreferences.edit().clear().commit();
    }
}
